package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.OrdersService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 夏帮连
 * @date: 2025/06/27
 * @description: 工作台接口
 * @version: 1.0
 */
@RestController
@RequestMapping("/admin/workspace")
@Slf4j
public class WorkspaceController {
    @Autowired
    private OrdersService ordersService;
    /**
     * 查询今日运营数据
     * @return Result
     */
    @GetMapping("/businessData")
    public Result<BusinessDataVO> getBusinessData() {
        BusinessDataVO businessData =ordersService.getBusinessData();
        return Result.success(businessData);
    }
    /**
     * 查询套餐总览
     * @return Result
     */
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> getOverviewSetmeals() {
        SetmealOverViewVO setmealOverViewVO=ordersService.getOverviewSetmeals();
        return Result.success(setmealOverViewVO);
    }
    /**
     * 查询菜品总览
     * @return Result
     */
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> getOverviewDishes() {
        DishOverViewVO dishOverViewVO=ordersService.getOverviewDishes();
        return Result.success(dishOverViewVO);
    }
    /**
     * 查询订单管理数据
     * @return Result
     */
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> getOverviewOrders() {
        OrderOverViewVO orderOverViewVO=ordersService.getOverviewOrders();
        return Result.success(orderOverViewVO);
    }

}
